package com.snowfield.lb47.lbconfig.domain;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.HashMap;
import java.util.List;

/**
 * 前端代理对象 config_frontproxy
 *
 * @author snowfield
 * @date 2024-04-01
 */
public class FrontProxy extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 标识ID
     */
    @Excel(name = "标识ID")
    private Long id;

    /**
     * 代理名称
     */
    @Excel(name = "代理名称")
    private String proxyName;

    /**
     * 绑定设备(双主模式时应用，主masterA,从masterB)
     */
    @Excel(name = "绑定设备")
    private String bindDevice = "masterA";

    /**
     * 绑定地址
     */
    @Excel(name = "绑定地址")
    private String bindIp;

    /**
     * 绑定端口
     */
    @Excel(name = "绑定端口")
    private Integer bindPort;

    /**
     * 模式
     */
    @Excel(name = "模式")
    private String mode;

    /**
     * 最大连接
     */
    private Integer maxconn;

    /**
     * 调度算法
     */
    @Excel(name = "调度算法")
    private String balance;

    /**
     * balance args
     * 调度算法配置参数
     */
    private String balanceArgs;

    /**
     * 页面使用，balance args配置内容对象，
     * 页面不能直接使用字符串balanceArgs，所以增加此MAP
     */
    private HashMap<String,Object> balanceArgsDisplay;

    /**
     * cookie
     */
    private String cookie;

    /**
     * cookieConfig
     */
    private String cookieConfig;

    /**
     * 页面使用，cookie配置内容对象，
     * 页面不能直接使用字符串cookieConfig，所以增加此MAP
     */
    private HashMap<String,Object> cookieConfigDisplay;

    /**
     * stickTable开关
     */
    private String stickTable;

    /**
     * 健康检测方式
     */
    @Excel(name = "健康检测方式")
    private String healthCheck;

    /**
     * 检测参数标识ID
     */
    @Excel(name = "检测参数")
    private Long checkParamId;

    /**
     * Http检测配置
     */
    private String httpCheckConfig;

    /**
     * sslOffloading
     */
    private String sslOffloading;

    /**
     * 代理证书标识ID
     */
    private Long proxyCrtId;

    /**
     * http2https
     */
    private String http2https;

    /**
     * sslMinVer
     */
    private String sslMinVer = "TLSv1.2";

    /**
     * sslMaxVer
     */
    private String sslMaxVer = "TLSv1.2";

    /**
     * 数据压缩
     */
    private String compression;

    /**
     * 数据缓存
     */
    private String cache;

    /**
     * http basic auth: 0/1
     */
    private String httpauth;

    /**
     * http认证路径，多个间用","分开，单个以"/"开头
     */
    private String httpauthPath;

    /**
     * 认证用户名
     */
    private String httpauthUsername;

    /**
     * 认证密码
     */
    private String httpauthPasswd;

    /**
     * md5加密后的认证密码
     */
    private String httpauthEnpasswd;

    /**
     * 慢攻击防护
     */
    private String showAttack;

    /**
     * ddos防护
     */
    private String ddos;

    /**
     * waf防护
     */
    private String waf;

    /**
     * 机器人攻击防护
     */
    private String antibot;

    /**
     * 黑白名单配置类型，nosetting:不配置,black:黑名单,white:白名单
     */
    private String blackwhiteType = "nosetting";

    /**
     * 黑名单列表标识ID
     */
    private Long blackListId;

    /**
     * 白名单列表标识ID
     */
    private Long whiteListId;

    /**
     * forwardfor
     */
    private String forwardfor;

    /**
     * redispatch
     */
    private String redispatch;

    /**
     * keepalive
     */
    private String keepalive;

    /**
     * 状态
     */
    private String status;

    /**
     * 后端服务器列表
     */
    private List<FrontProxyServer> frontProxyServerList;

    /**
     * ACL列表
     */
    private List<FrontProxyAcl> frontProxyAclList;

    /**
     * Header列表
     */
    private List<FrontProxyHeader> frontProxyHeaderList;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setProxyName(String proxyName) {
        this.proxyName = proxyName;
    }

    public String getProxyName() {
        return proxyName;
    }

    public String getBindDevice() {
        return bindDevice;
    }

    public void setBindDevice(String bindDevice) {
        this.bindDevice = bindDevice;
    }

    public void setBindIp(String bindIp) {
        this.bindIp = bindIp;
    }

    public String getBindIp() {
        return bindIp;
    }

    public void setBindPort(Integer bindPort) {
        this.bindPort = bindPort;
    }

    public Integer getBindPort() {
        return bindPort;
    }

    public void setMode(String mode) {
        this.mode = mode;
    }

    public String getMode() {
        return mode;
    }

    public void setMaxconn(Integer maxconn) {
        this.maxconn = maxconn;
    }

    public Integer getMaxconn() {
        return maxconn;
    }

    public void setBalance(String balance) {
        this.balance = balance;
    }

    public String getBalance() {
        return balance;
    }

    public String getBalanceArgs() {
        return balanceArgs;
    }

    public void setBalanceArgs(String balanceArgs) {
        this.balanceArgs = balanceArgs;
    }

    public HashMap<String, Object> getBalanceArgsDisplay() {
        return balanceArgsDisplay;
    }

    public void setBalanceArgsDisplay(HashMap<String, Object> balanceArgsDisplay) {
        this.balanceArgsDisplay = balanceArgsDisplay;
    }

    public void setHealthCheck(String healthCheck) {
        this.healthCheck = healthCheck;
    }

    public String getHealthCheck() {
        return healthCheck;
    }

    public void setHttpCheckConfig(String httpCheckConfig) {
        this.httpCheckConfig = httpCheckConfig;
    }

    public String getHttpCheckConfig() {
        return httpCheckConfig;
    }

    public Long getCheckParamId() {
        return checkParamId;
    }

    public void setCheckParamId(Long checkParamId) {
        this.checkParamId = checkParamId;
    }

    public void setCookie(String cookie) {
        this.cookie = cookie;
    }

    public String getCookie() {
        return cookie;
    }

    public String getCookieConfig() {
        return cookieConfig;
    }

    public void setCookieConfig(String cookieConfig) {
        this.cookieConfig = cookieConfig;
    }

    public HashMap<String, Object> getCookieConfigDisplay() {
        return cookieConfigDisplay;
    }

    public void setCookieConfigDisplay(HashMap<String, Object> cookieConfigDisplay) {
        this.cookieConfigDisplay = cookieConfigDisplay;
    }

    public String getStickTable() {
        return stickTable;
    }

    public void setStickTable(String stickTable) {
        this.stickTable = stickTable;
    }

    public String getSslOffloading() {
        return sslOffloading;
    }

    public void setSslOffloading(String sslOffloading) {
        this.sslOffloading = sslOffloading;
    }

    public Long getProxyCrtId() {
        return proxyCrtId;
    }

    public void setProxyCrtId(Long proxyCrtId) {
        this.proxyCrtId = proxyCrtId;
    }

    public void setHttp2https(String http2https) {
        this.http2https = http2https;
    }

    public String getHttp2https() {
        return http2https;
    }

    public String getSslMaxVer() {
        return sslMaxVer;
    }

    public void setSslMaxVer(String sslMaxVer) {
        this.sslMaxVer = sslMaxVer;
    }

    public String getSslMinVer() {
        return sslMinVer;
    }

    public void setSslMinVer(String sslMinVer) {
        this.sslMinVer = sslMinVer;
    }

    public void setCompression(String compression) {
        this.compression = compression;
    }

    public String getCompression() {
        return compression;
    }

    public void setCache(String cache) {
        this.cache = cache;
    }

    public String getCache() {
        return cache;
    }

    public String getHttpauth() {
        return httpauth;
    }

    public void setHttpauth(String httpauth) {
        this.httpauth = httpauth;
    }

    public String getHttpauthPath() {
        return httpauthPath;
    }

    public void setHttpauthPath(String httpauthPath) {
        this.httpauthPath = httpauthPath;
    }

    public String getHttpauthUsername() {
        return httpauthUsername;
    }

    public void setHttpauthUsername(String httpauthUsername) {
        this.httpauthUsername = httpauthUsername;
    }

    public String getHttpauthPasswd() {
        return httpauthPasswd;
    }

    public void setHttpauthPasswd(String httpauthPasswd) {
        this.httpauthPasswd = httpauthPasswd;
    }

    public String getHttpauthEnpasswd() {
        return httpauthEnpasswd;
    }

    public void setHttpauthEnpasswd(String httpauthEnpasswd) {
        this.httpauthEnpasswd = httpauthEnpasswd;
    }

    public void setShowAttack(String showAttack) {
        this.showAttack = showAttack;
    }

    public String getShowAttack() {
        return showAttack;
    }

    public void setDdos(String ddos) {
        this.ddos = ddos;
    }

    public String getDdos() {
        return ddos;
    }

    public void setWaf(String waf) {
        this.waf = waf;
    }

    public String getWaf() {
        return waf;
    }

    public void setAntibot(String antibot) {
        this.antibot = antibot;
    }

    public String getAntibot() {
        return antibot;
    }

    public String getBlackwhiteType() {
        return blackwhiteType;
    }

    public void setBlackwhiteType(String blackwhiteType) {
        this.blackwhiteType = blackwhiteType;
    }

    public Long getBlackListId() {
        return blackListId;
    }

    public void setBlackListId(Long blackListId) {
        this.blackListId = blackListId;
    }

    public Long getWhiteListId() {
        return whiteListId;
    }

    public void setWhiteListId(Long whiteListId) {
        this.whiteListId = whiteListId;
    }

    public void setForwardfor(String forwardfor) {
        this.forwardfor = forwardfor;
    }

    public String getForwardfor() {
        return forwardfor;
    }

    public void setRedispatch(String redispatch) {
        this.redispatch = redispatch;
    }

    public String getRedispatch() {
        return redispatch;
    }

    public String getKeepalive() {
        return keepalive;
    }

    public void setKeepalive(String keepalive) {
        this.keepalive = keepalive;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatus() {
        return status;
    }

    public List<FrontProxyServer> getFrontProxyServerList() {
        return frontProxyServerList;
    }

    public void setFrontProxyServerList(List<FrontProxyServer> frontProxyServerList) {
        this.frontProxyServerList = frontProxyServerList;
    }

    public List<FrontProxyAcl> getFrontProxyAclList() {
        return frontProxyAclList;
    }

    public void setFrontProxyAclList(List<FrontProxyAcl> frontProxyAclList) {
        this.frontProxyAclList = frontProxyAclList;
    }

    public List<FrontProxyHeader> getFrontProxyHeaderList() {
        return frontProxyHeaderList;
    }

    public void setFrontProxyHeaderList(List<FrontProxyHeader> frontProxyHeaderList) {
        this.frontProxyHeaderList = frontProxyHeaderList;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("proxyName", getProxyName())
                .append("bindDevice", getBindDevice())
                .append("bindIp", getBindIp())
                .append("bindPort", getBindPort())
                .append("mode", getMode())
                .append("maxconn", getMaxconn())
                .append("balance", getBalance())
                .append("balanceArgs", getBalanceArgs())
                .append("healthCheck", getHealthCheck())
                .append("httpCheckConfig", getHttpCheckConfig())
                .append("compression", getCompression())
                .append("cache", getCache())
                .append("http2https", getHttp2https())
                .append("showAttack", getShowAttack())
                .append("ddos", getDdos())
                .append("waf", getWaf())
                .append("antibot", getAntibot())
                .append("blackwhiteType", getBlackwhiteType())
                .append("blackListId", getBlackListId())
                .append("whiteListId", getWhiteListId())
                .append("forwardfor", getForwardfor())
                .append("redispatch", getRedispatch())
                .append("keepalive", getKeepalive())
                .append("cookie", getCookie())
                .append("status", getStatus())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}
